# Maintainer: Peter Budai <peterbudai at hotmail dot com>

_realname=osm-gps-map
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.2.0
pkgrel=3
pkgdesc="A Gtk+ Widget for Displaying OpenStreetMap tiles. (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://nzjrs.github.io/osm-gps-map/"
msys2_repository_url="https://github.com/nzjrs/osm-gps-map"
license=("spdx:GPL-2.0-only")
depends=(
    "${MINGW_PACKAGE_PREFIX}-cairo"
    "${MINGW_PACKAGE_PREFIX}-gdk-pixbuf2"
    "${MINGW_PACKAGE_PREFIX}-gettext-runtime"
    "${MINGW_PACKAGE_PREFIX}-glib2"
    "${MINGW_PACKAGE_PREFIX}-gtk3"
    "${MINGW_PACKAGE_PREFIX}-libsoup"
)
makedepends=(
    "${MINGW_PACKAGE_PREFIX}-cc"
    "${MINGW_PACKAGE_PREFIX}-autotools"
    "${MINGW_PACKAGE_PREFIX}-gnome-common"
    "${MINGW_PACKAGE_PREFIX}-gobject-introspection"
    "${MINGW_PACKAGE_PREFIX}-gtk-doc"
)
source=(https://github.com/nzjrs/osm-gps-map/releases/download/${pkgver}/${_realname}-${pkgver}.tar.gz) 
sha256sums=('ddec11449f37b5dffb4bca134d024623897c6140af1f9981a8acc512dbf6a7a5')

prepare() {
    cd "${srcdir}/${_realname}-${pkgver}"
    # autoreconf to get updated libtool files for clang
    autoreconf -fiv
}

build() {
    mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}

    export lt_cv_deplibs_check_method='pass_all'

    CFLAGS+=" -DG_DISABLE_ASSERT"
    ../${_realname}-${pkgver}/configure \
        --prefix="${MINGW_PREFIX}"      \
        --enable-gtk-doc=no

  make
}

package() {
  cd "${srcdir}/build-${MSYSTEM}"
  make DESTDIR="${pkgdir}" install
}
